package com.mspbots.ticketai;

import com.mspbots.ticketai.service.NextTicketClickedReportsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.Assert;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;


/**
 * @author sean.wang
 */
@RestController
@RequestMapping("tickets")
public class TicketReportsController {

    @Autowired
    private NextTicketClickedReportsService nextTicketClickedReports;

    @PostMapping("nextTicketClickedReport")
    public void nextTicketClicked(@RequestBody Map<String, Object> params) {
        Assert.notNull(params.get("tenantId"), "Request Params [tenantId] not null");
        Assert.notNull(params.get("identifier"), "Request Params [identifier] not null");
        Assert.notNull(params.get("cwId"), "Request Params [cwId] not null");

        nextTicketClickedReports.nextTicketClicked(params);
    }
}
